<%--
  Created by IntelliJ IDEA.
  User: ChadZhao
  Date: 12-2-7
  Time: 下午1:39
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>南京地税廉政网</title>
    <link href="<c:url value='/styles/sub.css'/>" rel="stylesheet" type="text/css">
    <style type="text/css">
        .button { background-image:url(<c:url value='/images/butbg.gif'/>); height:30px; line-height:30px; color:#FFFFFF; font-weight:bold; border:0px; cursor:hand;}
        .list a:link { color: #333333; text-decoration: none; font-family: "微软雅黑";}
        .list a:visited{ color: #333333; text-decoration: none; font-family: "微软雅黑";}
        .list a:hover {color:#666666; font-family: "微软雅黑";}
    </style>
</head>
<body>
<jsp:include page="/top.jsp"/>
<form method="post">
<table width="1000"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="310" align="left" valign="top">
        <jsp:include page="/menu.jsp"/>
    </td>
    <td align="right" valign="top">
        <table width="670"  border="0" cellpadding="0" cellspacing="0" class="bk4">
      <tr>
        <td bgcolor="#f1f1f0"><jsp:include page="/pathmessage.jsp"/></td>
      </tr>
      <tr>
        <td>
            <table width="633"  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr align="center">
              <td><img src="<c:url value='/images/sub2_03.jpg'/>" width="633" height="107"></td>
              </tr>
          </table>
          <table width="633"  border="0" align="center" cellpadding="0" cellspacing="0" class="list">
            <s:if test="pageVO != null">
            <s:if test="partType == \"2\" || partType == \"8\" || partType == \"18\" || partType == \"28\" || partType == \"29\" || partType == \"30\"">
                <s:iterator value="%{pageVO.dataList}" id="dl" status="num">
                    <s:if test="#num.index%2==0">
                        <tr>
                          <td width="1"></td>
                          <td width="315" style="text-align:center;">
                              <a href="<c:url value='/viewArticleInfo.do?articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>" target="_blank">
                                  <img src="<s:property value="#dl.IMAGEURL"/>" style="border:0px;" width="240" height="180">
                                 <p style="width: 310px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"><s:property value="#dl.TITLE"/></p>
                              </a>
                          </td>
                    </s:if>
                    <s:else>
                          <td width="315" style="text-align:center;">
                              <a href="<c:url value='/viewArticleInfo.do?articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>" target="_blank">
                                  <img src="<s:property value="#dl.IMAGEURL"/>" style="border:0px;" width="240" height="180">
                                 <p style="width: 310px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"><s:property value="#dl.TITLE"/></p>
                              </a>
                          </td>
                        </tr>
                    </s:else>
                </s:iterator>
            </s:if>
                <s:else>
                    <s:iterator value="%{pageVO.dataList}" id="dl" status="num">
                    <tr>
                      <td width="23"><img src="<c:url value='/images/sub2_06.jpg'/>" width="8" height="8"> </td>
                      <td width="520"><a href="<c:url value='/viewArticleInfo.do?articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>" target="_blank" style="width: 510px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"><s:property value="#dl.TITLE"/></a></td>
                      <td width="80" align="right"><span class="date"><s:property value="#dl.VERIFYDATE"/></span></td>
                    </tr>
                </s:iterator>
                </s:else>
                <tr style="height:26px;font-size: 12px;">
            <td colspan="3" style="padding-right:6px;text-align: right;">
                共<s:property value="%{pageVO.totalCount}"/>条
                共<s:property value="%{pageVO.totalPage}"/>页
                第<s:property value="%{pageVO.currentPage}"/>页
                <s:if test="%{pageVO.currentPage > 1}">
                    <a href="#" onclick='toPage(1);return false;'>[首页]</a>
                    <a href="#"
                       onclick='toPage(<s:property value="pageVO.priviousPage"/>);return false'>[上一页]</a>
                </s:if>
                <s:if test="%{pageVO.totalPage > pageVO.currentPage}">
                    <a href="#" onclick='toPage(<s:property value="pageVO.nextPage"/>);return false;'>[下一页]</a>
                    <a href="#" onclick='toPage(<s:property value="pageVO.totalPage"/>);return false;'>[尾页]</a>
                </s:if>
                <input name="goPage" type="text" class="listinput" style="width:28px;" size="1"/>&nbsp;
                <button type="button" class="button" style="width:32px;" onClick="jumpToPage()">GO</button>
                &nbsp;
            </td>
        </tr>
            </s:if>
          </table>
        </td>
      </tr>
      </tr>
    </table></td>
  </tr>
</table>
    </form>
<jsp:include page="/bottom.jsp"/>
</body>
<script type="text/javascript">

    function toPage(pageNum) {
        document.forms[0].action = "<c:url value='/viewArticleList.do?partType='/><s:property value="partType"/>&targerPageNum="+ pageNum;
        document.forms[0].submit();
    }

    function jumpToPage() {
        var iForm = document.forms[0];
        if (iForm.goPage.value == "") {
            alert("请输入要跳转到的页数！");
            return;
        }
        if (isNaN(iForm.goPage.value)) {
            alert("页数只能为整数！");
            return;
        }
        var toPageNum = parseInt(iForm.goPage.value);
        if (toPageNum < 1 || toPageNum > <s:if test="%{pageVO.totalPage != null}"><s:property value="%{pageVO.totalPage}"/></s:if><s:else>1</s:else>) {
            alert("页数输入有误！");
            return;
        }
        toPage(toPageNum);
    }
</script>
</html>